import request from "@/utils/request";

// 用户模块URL
const GROUP_BASE_URL = "/admin";

const UserGroupAPI = {
    /**
     * 获取用户组列表
     * @param queryParams
     * @returns
     */
    getList(queryParams: any) {
        return request<any, any>({
            url: `${GROUP_BASE_URL}/user/group/list`,
            method: "get",
            params: queryParams,
        });
    },
    /**
     * 添加用户组
     * @param
     * @returns
     */
    addUserGroup(params: any) {
        return request<any, any>({
            url: `${GROUP_BASE_URL}/user/group/add`,
            method: "post",
            params: params,
        });
    },

    /**
     * 获取用户组详情  用于编辑
     * @param
     * @returns
     */
    getUserGroupInfo(id: any) {
        return request<any, any>({
            url: `${GROUP_BASE_URL}/user/group/info`,
            method: "get",
            params: { id },
        });
    },

    /**
     * 查看用户组详情 用于展示
     * @param
     * @returns
     */
    viewUserGroup(params: any) {
        return request<any, any>({
            url: `${GROUP_BASE_URL}/user/group/detail`,
            method: "get",
            params: params,
        });
    },

    /**
     * 编辑用户组详情
     * @param
     * @returns
     */
    editUserGroupInfo(params: any) {
        return request<any, any>({
            url: `${GROUP_BASE_URL}/user/group/edit`,
            method: "post",
            params: params,
        });
    },

    /**
     * 修改用户组状态
     * @param
     * @returns
     */
    updateStatus(params: any) {
        return request<any, any>({
            url: `${GROUP_BASE_URL}/user/group/updateStatus`,
            method: "post",
            params: params,
        });
    },

    // ========================
    /**
     * 获取左侧新增用户列表成员
     * @param
     * @returns
     */
    getUserList(params: any) {
        return request<any, any>({
            url: `${GROUP_BASE_URL}/user/group/userList`,
            method: "get",
            params: params,
        });
    },

    /**
     * 新增用户组成员
     * @param
     * @returns
     */
    addUserGroupUserUser(params: any) {
        return request<any, any>({
            url: `${GROUP_BASE_URL}/user/group/addUser`,
            method: "post",
            params: params,
        });
    },
    /**
     * 新增用户组成员 右侧李彪
     * @param
     * @returns
     */
    getUserGroupChoosedUser(params: any) {
        return request<any, any>({
            url: `${GROUP_BASE_URL}/user/group/userSelected`,
            method: "get",
            params: params,
        });
    },
    /**
     * 查看用户组成员
     * @param
     * @returns
     */
    viewUserGroupUser(params: any) {
        return request<any, any>({
            url: `${GROUP_BASE_URL}/user/group/groupUserList`,
            method: "get",
            params: params,
        });
    },
};

export default UserGroupAPI;
